<?php

	class News extends CI_Model
	{
		function __construct()
		{
			parent::__construct();
		}

		function getAll($limit = false)
		{
			$query = $this->db->get('news');

			if($limit)
			{
				$query = $this->db->get('news',$limit,0);
			}
			
			return $query->result_array();
		}

		function addNew($data)
		{
			return $this->db->insert('news',$data);
		}

		function getNew($id = false)
		{
			$query = $this->db->get_where('news',array('id'=>$id));
			return $query->row_array();
		}
	}